#include "utils/StringUtil.h"
#if(__cplusplus == 201103L)
#include "cxx-prettyprint/prettyprint.hpp"
#else
#include "cxx-prettyprint/prettyprint98.hpp"
#endif
#include <string>
#include <vector>
#include <iostream>

void Test_StringUtil()
{
    using namespace tb;
    using namespace std;
    
    string src = "ad,,,,,adbasdfsd|vdfsaf..fd sfas|fdsaf,ad";
    vector<string> vec_split;
    tb::StringUtil::split(src, vec_split, "..");
    std::cout << "vec_split: " << vec_split << endl;

    vector<string> vec_cut;
    tb::StringUtil::cut(src, vec_cut, "..");
    std::cout << "vec_cut: " << vec_cut << endl;

    string trimLeftSrc = src;
    cout << "trimLeftSrc: " << trimLeftSrc << endl;
    tb::StringUtil::lstrip(trimLeftSrc, ',');
    cout << "trimLeftSrc: " << trimLeftSrc << endl;

    string trimRightSrc = src;
    tb::StringUtil::rstrip(trimRightSrc, ',');
    cout << "trimRightSrc: " << trimRightSrc << endl;

    string trimSrc = src;
    tb::StringUtil::strip(trimSrc, ',');
    cout << "trimSrc: " << trimSrc << endl;

    string upper_str = tb::StringUtil::upper_string(src);
    cout << "upper_str: " << upper_str << endl;

    string stripSrc = src;
    cout << tb::StringUtil::strip(src, "ad") << endl;
}
